package com.example.shopspring.controller;

import com.example.shopspring.common.ApiConstant;
import com.example.shopspring.common.ResultData;
import com.example.shopspring.service.StaFirstService;
import com.example.shopspring.service.StaSecondService;
import com.example.shopspring.service.StaThirdService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ApiConstant.API_VERSION + "/sta")
@Slf4j
public class StaController {

    @Resource
    private StaFirstService staFirstService;
    @Resource
    private StaSecondService staSecondService;
    @Resource
    private StaThirdService staThirdService;

    @GetMapping("/first/get_list")
    ResultData firstGetList() {
        return staFirstService.getList(0);
    }

    @GetMapping("/second/get_sales_record/{type}")
    ResultData getSalesRecord(@PathVariable String type){
        return staSecondService.getStaSales(type);
    }

    @GetMapping("/third/get_list")
    ResultData thirdGetList(){
        return staThirdService.getStaList();
    }
}
